//
//  NoticeDetailViewController.m
//  PlayBall
//
//  Created by Jdd‘s macbook on 13-9-24.
//
//

#import "JddNoticeDetailViewController.h"
#import "SBJsonParser.h"
@interface JddNoticeDetailViewController ()

@end

@implementation JddNoticeDetailViewController

-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:YES];
    [MobClick beginLogPageView:@"NoticeDetail"];

}
- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    [MobClick endLogPageView:@"NoticeDetail"];
}
- (void)viewDidLoad
{
    [super viewDidLoad];
    
    [self.navigationItem setTitle:PAGE_HOME];
    [JddCommonFunction setWaitingViewHidden:NO fromController:self];
    JddNoticeDetailOperation *operation = [[JddNoticeDetailOperation alloc] init];
    operation.delegate = self;
    operation.noticeId = self.noticeId;
    [[JddGlobalParameter sharedInstance].operationQueue addOperation:operation];
}


-(void)NoticeDetailOperationResult:(NSData *)result{
    if (result) {
        NSString *strResult = [JddDataParser parseLoginResult:result];
        if (strResult.length > 0){
            SBJsonParser *jsonparse = [[SBJsonParser alloc] init];
          NSDictionary *noticeDic = [jsonparse objectWithString:strResult];
            self.titleLbl.text = [noticeDic objectForKey:@"Title"];
            self.DateTime.text = [noticeDic objectForKey:@"DateTime"];
            
            [self.webView loadHTMLString:[noticeDic objectForKey:@"Content"] baseURL:nil];
        }
    }
    [JddCommonFunction setWaitingViewHidden:YES fromController:self];
}


- (void)viewDidUnload {
    [self setTitleLbl:nil];
    [self setDateTime:nil];
    [self setWebView:nil];
    [super viewDidUnload];
}
@end
